package com.lmk.feign;


import com.lmk.domain.Store;
import com.lmk.util.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;
@Component
public class StoreServiceFallbackFactory implements FallbackFactory<StoreServices> {

    @Override
    public StoreServices create(Throwable throwable) {
        return new StoreServices() {
            @Override
            public List<Store> getAll() {
                return null;
            }

            @Override
            public Store getById(Long id) {
                return null;
            }

            @Override
            public AjaxResult addorupdate(Store store) {
                return AjaxResult.me().setSuccess(false).setMsg("触发熔断！！！服务不可用");
            }

            @Override
            public AjaxResult del(Long id) {
                return null;
            }
        };
    }
}
